Value Class Definitions
This section describes the AppleScript value classes. Table 3-1 summarizes the class identifiers recognized by AppleScript.
AppleScript value class identifiers
Value class identifier | Description of corresponding value |
---|
Boolean | A logical truth value |
Class | A class identifier |
Constant | A reserved word defined by an application or AppleScript |
Data | Raw data that cannot be represented in AppleScript, but can be stored in a variable |
Date | A string that specifies a day of the week, day of the month, month, year, and time |
Integer | A positive or negative number without a fractional part |
List | An ordered collection of values |
Number | Synonym for class Integer or class Real; a positive or negative number that can be either of class Integer or of class Real |
Real | A positive or negative number that can have a fractional part |
Record | A collection of properties |
Reference | A reference to an object |
String | An ordered series of characters |
Styled Text | Synonym for a special string that includes style and font information |
Text | Synonym for class string |
Three identifiers in Table 3-1 act only as synonyms for other value classes: Number is a synonym for either Integer or Real, Text is a synonym for String, and Styled Text is a synonym for a string that contains style and font information. You can coerce values using these synonyms, but the class of the resulting value is always the true value class.
For example, you can use the class identifier Text to coerce a date to a string:
set x to date "May 14, 1993" as text
class of x
--result: string
Although definitions for value class synonyms are included in the sections that follow, they do not correspond to separate value classes. For more information about coercing values using synonyms, see "Coercing Values," which begins on page 66.